/*************************************************
 * 
 * Copyright by Bruno Eberhard
 * 
 * Created on 30.07.2005
 *
 *************************************************/
package fightplan.ui;

import java.awt.Component;

import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

@SuppressWarnings("serial")
public class BeanPropertyListCellRenderer extends DefaultListCellRenderer {
	private String property;

	public BeanPropertyListCellRenderer(String property) {
		this.property = property;
	}

	public Component getListCellRendererComponent(JList list, Object object, int index, boolean isSelected,
			boolean cellHasFocus) {

		Object value = BeanListTableModel.getPropertyValue(object, property);
		return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
	}

}
